/**
 * 
 */
package edu.cmu.lti.lm.dt;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;


/**
 * @author qing
 *
 */
public class Entry {
	private static Map<String,String> mp = new HashMap<String,String>();
	private static Set<Feature> feat = new HashSet<Feature>();
	private String word = "";
	private Map<Feature,String> feature  = new HashMap<Feature,String>();
	public Entry(String word, History hist) {
		super();
		String w = mp.get(word);
		if(w!=null){
			this.word = w;
		}
		else{
			this.word = word;
			mp.put(word, word);
		}
			
		
		Iterator<Feature> it = feat.iterator();
		while(it.hasNext()){
			Feature f  = it.next();
			String s = f.getValue(hist);
			feature.put(f, s);
		}
	}
	public String getWord() {
		return word;
	}
	public void setWord(String word) {
		this.word = word;
	}
	public void clear() {
		feature.clear();
	}
	public boolean containsKey(Object key) {
		return feature.containsKey(key);
	}
	public boolean containsValue(Object value) {
		return feature.containsValue(value);
	}
	public Set<Map.Entry<Feature, String>> entrySet() {
		return feature.entrySet();
	}
	public boolean equals(Object o) {
		return feature.equals(o);
	}
	public String get(Object key) {
		return feature.get(key);
	}
	public int hashCode() {
		return feature.hashCode();
	}
	public boolean isEmpty() {
		return feature.isEmpty();
	}
	public Set<Feature> keySet() {
		return feature.keySet();
	}
	public String put(Feature key, String value) {
		return feature.put(key, value);
	}
	public void putAll(Map<? extends Feature, ? extends String> t) {
		feature.putAll(t);
	}
	public String remove(Object key) {
		return feature.remove(key);
	}
	public int size() {
		return feature.size();
	}
	public Collection<String> values() {
		return feature.values();
	}
	public static Set<Feature> getFeat() {
		return feat;
	}
	public static void setFeat(Set<Feature> feat) {
		Entry.feat = feat;
	}
	
	
}
